<?php
class ORMOrderEvent extends ORMBase {
  public function __construct() {
    parent::__construct('OrderEvent');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->keyword = isset($object->keyword) ? $object->keyword : '';
    $epObject->date = isset($object->date) ? SimpleDate::toStamp($object->date) : 0;
    $epObject->registrar = isset($object->registrar) ? $object->registrar : '';
    $epObject->content = isset($object->content) ? $object->content : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->keyword = $epObject->keyword;
    $object->date = SimpleDate::fromStamp($epObject->date);
    $object->registrar = $epObject->registrar;
    $object->content = $epObject->content;
    return $object;
  }
}
?>
